<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>相册管理</title>
    <!--  抽取公共头部-->
    <div th:replace="admin/common :: head"></div>
</head>
<body>

<!--抽取公共导航栏-->
<div th:replace="admin/common :: menu(5)"></div>

<div class="m-padded-tb-hugex">
    <div class="ui attached pointing menu">
        <div class="ui container">
            <div class="right menu">
                <a href="#" th:href="@{/admin/violence/input}" class="item">新增</a>
                <a href="#" th:href="@{/admin/violence}" class="teal active item">列表</a>
            </div>
        </div>
    </div>
</div>

<!--中间内容-->
<div class="m-padded-tb-big">
    <div class="ui container">
        <!--消息提示-->
        <div class="ui success message">
            <i class="close icon"></i>
            <div th:text="|提示： ${message}" class="">提示：恭喜，操作成功！</div>
        </div>
        <form th:action="@{/admin/violence}" method="post">
            <div  class="ui secondary segment form">
                <div class="inline fields">
                    <div class="field">
                        <input type="text" name="violencename"  th:value="${condition.violencename}" placeholder="暴行名称">
                    </div>
                    <div class="field">
                        <button  type="submit" class="ui mini teal basic button"><i class="search icon"></i>搜索</button>
                    </div>
                </div>
            </div>
        </form>
        <table class="ui compact teal table">
            <thead>
            <tr align="center">
                <th>ID</th>
                <th>暴行名称</th>
                <th>时间地点</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="violence,iterStat:${pager.datas}" align="center">
                <td th:text="${iterStat.count}">1</td>
                <td th:text="${violence.violencename}">东西冲徒步</td>
                <td th:text="${#dates.format(violence.createTime,'yyyy/MM/dd')}">2019年12月31日 深圳</td>
                <td>
                    <a href="#" th:href="@{/admin/violence/{violence_id}/input(violenceId=${violence.violenceId})}" class="ui mini teal basic button">编辑</a>
                    <a href="#" th:href="@{/admin/violence/delete(violenceId=${violence.violenceId})}" onclick="return confirm('确定要删除该照片吗？三思啊! 删了可就没了！')" class="ui mini red basic button">删除</a>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <th colspan="6">
                    <div class="ui inverted divided stackable grid">
                        <div class="three wide column" align="center">
                            <a th:href="@{/admin/violence(page=${pager.page}-1)}" class="item"
                               th:if="${pager.has_pre}">上一页</a>
                        </div>

                        <div class="ten wide column" align="center">
                            <p>第 <span></span> 页，共 <span></span> 页，有 <span></span> 个分类</p>
                        </div>

                        <div class="three wide column" align="center">
                            <a th:href="@{/admin/violence(page=${pager.page}+1)}" class="item"
                               th:if="${pager.has_next}">下一页</a>
                        </div>
                    </div>
                    <div align="center">
                        <a th:href="@{/admin/violence/input}" href="#">
                            <button type="button" class="ui teal button m-mobile-wide m-margin-top"><i
                                    class="pencil icon"></i>新增
                            </button>
                        </a>
                    </div>
                </th>
            </tr>
            </tfoot>
        </table>
    </div>
</div>

<br>
<br>
<!--抽取公共底部栏-->
<div th:replace="admin/common :: #footer"></div>

<!--抽取公共js-->
<div th:replace="admin/common :: #js"></div>

<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
        on: 'hover'
    });

    //消息提示关闭初始化
    $('.message .close')
        .on('click', function () {
            $(this)
                .closest('.message')
                .transition('fade');
        });
</script>
</body>
</html>